<div ng-controller="StoreCtrl" ng-init="storeXcxConfig()" class="sui-form form-horizontal">
    <ul class="sui-breadcrumb">
        <li>
            <a href="#/store/list">{{'store'|translate}}</a>
        </li>
        <li>
            <wx-app-list ng-model="app_id" ary="storeary" stype='1'></wx-app-list>
        </li>
        <li class="active">
            设置
        </li>
        <span class="sui-form sui-form pull-right">
        </span>
    </ul>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'下单用户范围'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="radio" ng-value="1" ng-model="OrderAddSet" />所有人
                        <input type="radio" ng-value="2" ng-model="OrderAddSet" />代理商
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('ADD_TRADE_TYPE','OrderAddSet')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'订单确认页面发货点显示选项'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="radio" ng-value="1" ng-model="DistributionZT" />配送类型
                        <font color="red">显示</font>
                        发货点，自提类型
                        <font color="red">不显示</font>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="radio" ng-value="2" ng-model="DistributionZT" />配送类型和自提类型都
                        <font color="red">显示
                        </font>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="radio" ng-value="3" ng-model="DistributionZT" />配送类型和自提类型都
                        <font color="red">不显示
                        </font>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="radio" ng-value="4" ng-model="DistributionZT" />配送类型
                        <font color="red">不显示</font>
                        ，自提类型
                        <font color="red">显示</font>
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-ISDISTRIBUTION','DistributionZT')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th colspan="4">{{'门店参数'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        收货地址名称：<input type="text" ng-model="storeConf.shouhuoname" value="{{storeConf.shouhuoname}}" />
                    </td>
                    <td>
                        自提点名称：<input type="text" ng-model="storeConf.zitiname" value="{{storeConf.zitiname}}" />
                    </td>
                    <td>
                        发货点名称：<input type="text" ng-model="storeConf.fahuoname" value="{{storeConf.fahuoname}}" />
                    </td>
                    <td>
                        关闭订单详请商品链接：<input type="radio" ng-value="0" ng-model="storeConf.closeItemLink" />开启跳转
                        <input type="radio" ng-value="1" ng-model="storeConf.closeItemLink" />关闭跳转
                    </td>
                </tr>
                <tr>
                    <td>
                        停止确认下单页面下单：<input type="radio" ng-value="0" ng-model="storeConf.closeOrderAdd" />开启下单
                        <input type="radio" ng-value="1" ng-model="storeConf.closeOrderAdd" />停止下单

                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-STORECONF','storeConf')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'支付是否验证手机'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="radio" ng-value="0" ng-model="payphone" />否
                        <input type="radio" ng-value="1" ng-model="payphone" />是
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-PAYPHONEYAN','payphone')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'是否订单分账？'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="radio" ng-value="0" ng-model="fenzhang" />否
                        <input type="radio" ng-value="1" ng-model="fenzhang" />是
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-FENZHANG','fenzhang')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'是否开启分销订单分账'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="radio" ng-value="0" ng-model="fenxiao_fenzhang" />否
                        <input type="radio" ng-value="1" ng-model="fenxiao_fenzhang" />是
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-FENXIAO-FENZHANG','fenxiao_fenzhang')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'收货方式'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="checkbox" checklist-value="1" checklist-model="deliveryTypes" />外送
                        <input type="checkbox" checklist-value="2" checklist-model="deliveryTypes" />自提
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-DELIVERY','deliveryTypes')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'我的页面菜单配置'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <label ng-repeat="userMenuBar in userMenuBars">
                            <input name="userMenuBar" type="checkbox" checklist-value="userMenuBar.value"
                                checklist-model="userMenuChecked" />
                            <input type="text" ng-model="userMenuBar.text" />
                        </label>
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-MENUBAR','userMenuChecked')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th colspan="3">{{'汇率设置'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="huilv in config['CONFIG-HUILV'].value[store_id]">
                    <td>
                        所有价格对应的货币符号：<input name="userMenuBar" type="text" ng-model="huilv.name" value="{{huilv.name?huilv.name:'￥'}}" />
                    </td>
                    <td>
                        人民币1元兑=<input name="fee" type="number" ng-model="huilv.fee" value="{{huilv.fee}}" />{{huilv.name?huilv.name:'￥'}}
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-HUILV','huilvs')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{"可选配送国家"|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <label ng-repeat="countryDeliveryObj in countryDelivery">
                            <input name="countryDeliveryObj" type="checkbox" checklist-value="countryDeliveryObj.value"
                                checklist-model="countryDeliveryChecked" />{{countryDeliveryObj.text}}
                        </label>
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-COUNTRYDELIVERY','countryDeliveryChecked')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{"小程序运费阶梯模板设置"|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <chose-freight-rule title="选择阶梯运费" chosed-items="deliveryFee" freight-check="DirectiveCb(ruleInfo)"></chose-freight-rule>
                        <table class="sui-table table-bordered" ng-repeat="list in freight_rule">
                            <thead>
                                <tr>
                                    <th colspan="3">
                                        <label class="checkbox pull-left">
                                            阶梯运费编号：{{list.freight_rule_id}} 基础运费：{{list.base_fee}} 元
                                        </label>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        距离附加费：
                                        <br />
                                        <span ng-repeat="(key, value) in list.distance_fees">
                                            {{value.lower}} - {{value.upper}} 公里时
                                            <span style="margin-left: 25px;" ng-show="!value.unit">
                                                +{{value.unit_fee}}元
                                                <br>
                                            </span>
                                        <span style="margin-left: 25px;" ng-show="value.unit">
                                                每{{value.unit}}公里+{{value.unit_fee}}元
                                                <br>
                                            </span>
                                        </span>
                                        <span ng-show="!list.distance_fees">无</span>
                                    </td>
                                    <td>
                                        重量附加费：
                                        <br />
                                        <span ng-repeat="(key, value) in list.weight_fees">
                                            {{value.lower}} - {{value.upper}} 公斤时
                                            <span style="margin-left: 25px;" ng-show="!value.unit">
                                                +{{value.unit_fee}}元
                                                <br>
                                            </span>
                                        <span style="margin-left: 25px;" ng-show="value.unit">
                                                每{{value.unit}}公斤+{{value.unit_fee}}元
                                                <br>
                                            </span>
                                        </span>
                                        <span ng-show="!list.weight_fees">无</span>
                                    </td>
                                    <td>
                                        特殊时段费：
                                        <br />
                                        <span ng-repeat="(key, value) in list.period_fees">
                                            {{value.start}} - {{value.end}}
                                            <span style="margin-left: 25px;"> +{{value.unit_fee}}元
                                                <br>
                                            </span>
                                        </span>
                                        <span ng-show="!list.period_fees">无</span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-DELIVERYFEE','deliveryFee')">{{'save'|translate}}</button>
        <button class="sui-btn btn-danger" ng-click="saveSetDelivery('CONFIG-DELIVERYFEE','deliveryFee',0)">{{'清除'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{"营业时间设置1"|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        开店时间：
                        <input type="text" data-toggle="timepicker" ng-model="BusinessHoursObj.start_time"> 关店时间：
                        <input type="text" data-toggle="timepicker" ng-model="BusinessHoursObj.end_time">
                        <button class="sui-btn btn-primary" ng-click="BusinessHoursObj.start_time='';BusinessHoursObj.end_time='';saveSetDelivery('CONFIG-BusinessHours','BusinessHoursObj')">不设置</button>
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-BusinessHours','BusinessHoursObj')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{"营业时间设置2"|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        开店时间：
                        <input type="text" data-toggle="timepicker" ng-model="BusinessHoursObj1.start_time"> 关店时间：
                        <input type="text" data-toggle="timepicker" ng-model="BusinessHoursObj1.end_time">
                        <button class="sui-btn btn-primary" ng-click="BusinessHoursObj1.start_time='';BusinessHoursObj1.end_time='';saveSetDelivery('CONFIG-BusinessHours1','BusinessHoursObj1')">不设置</button>
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-BusinessHours1','BusinessHoursObj1')">{{'save'|translate}}</button>
    </div>

    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{"营业时间设置3"|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        开店时间：
                        <input type="text" data-toggle="timepicker" ng-model="BusinessHoursObj2.start_time"> 关店时间：
                        <input type="text" data-toggle="timepicker" ng-model="BusinessHoursObj2.end_time">
                        <button class="sui-btn btn-primary" ng-click="BusinessHoursObj2.start_time='';BusinessHoursObj2.end_time='';saveSetDelivery('CONFIG-BusinessHours2','BusinessHoursObj2')">不设置</button>
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-BusinessHours2','BusinessHoursObj2')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th colspan="2">{{'收款二维码'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="radio" ng-value="0" ng-model="shoukuanQrCode.iscode" />不使用二维码付款
                        <input type="radio" ng-value="1" ng-model="shoukuanQrCode.iscode" />使用二维码付款
                    </td>
                    <td>
                        <div>
                            <div>
                                <img ng-src="{{shoukuanQrCode.codeStr}}" style="width:170px;height: 170px">
                            </div>
                            <label>
                                <br /> 链接：
                                <input ng-model="shoukuanQrCode.codeStr" type="text" name="name" value=""
                                    style="width:100px">
                                <attachment id="uploadattachdd" owner-id="item.item_id ?item.item_id:1"
                                    owner-type="item" dhf-ng-model="attchUrl" setback="setcallImg(attach)" xtype="url"
                                    mult="false" title="Upload" use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF">
                                </attachment>
                            </label>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-PAYQRCODE','shoukuanQrCode')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{"最低下单金额"|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>

                    <td>
                        最小下单金额（最低0.01） <input type="number" ng-model="minMoney.minmoney">
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-MINMONEY','minMoney')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{"物流查询设置"|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>

                    <td>
                        id <input type="text" ng-model="kuaidiConfig.wuliuappid"> 指定查询单号页面 <input type="text" ng-model="kuaidiConfig.wuliu">
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-KUAIDIGET','kuaidiConfig')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'关闭国外创建地址gps验证'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="radio" ng-value="0" ng-model="isAddressGps" />否
                        <input type="radio" ng-value="1" ng-model="isAddressGps" />是
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-ADDRESSGPS','isAddressGps')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'消费时间'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <!-- <select ng-model=""> -->
                        开始配送时间：
                        <input type="text" data-toggle="timepicker" ng-model="peisongObj.start_time"> 停止配送时间：
                        <input type="text" data-toggle="timepicker" ng-model="peisongObj.end_time">
                    </td>
                </tr>
                <tr>
                    <td>
                        生成时间天数(目前最多设置7天)：<input ng-model="peisongObj.daynum" type="number" min="1" max="7" /> 配送间隔时间(根据开始配送和停止配送生成的配送时间列表(也是到店消费时间列表))：
                        <peisong-jiange ng-model="peisongObj.datejiange"></peisong-jiange>
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-PEISONGDATE','peisongObj')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'折扣价显示方式'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="radio" ng-value="1" ng-model="isShowLevelPrice" />不按照等级，直接展示最优惠折扣价
                        <input type="radio" ng-value="2" ng-model="isShowLevelPrice" />按照等级展示最优惠价格
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-ShowLevelPrice','isShowLevelPrice')">{{'save'|translate}}</button>
    </div>
    <div style="margin-bottom: 40px">
        <table class="sui-table table-bordered" style="margin-bottom: 5px">
            <thead>
                <tr>
                    <th>{{'协议'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        标题 <input type="text" ng-model="OrderXieYi.title" placeholder="下单协议标题" />
                    </td>
                    <td>
                        <textarea ng-model="OrderXieYi.content" placeholder="下单协议内容" style="width:500px;height:50px;"></textarea>
                    </td>
                    <td>

                        <input type="radio" ng-value="0" ng-model="OrderXieYi.isautoopen" />默认关闭弹窗
                        <input type="radio" ng-value="1" ng-model="OrderXieYi.isautoopen" />自动打开弹窗
                    </td>
                </tr>
            </tbody>
        </table>
        <button class="sui-btn btn-primary" ng-click="saveSetDelivery('CONFIG-ORDERXIEYI','OrderXieYi')">{{'save'|translate}}</button>
    </div>
</div>